﻿using System;
using System.Windows.Forms;

namespace iCalSync
{
    public partial class ConnectForm : Form
    {
        public Uri authUri;
        public string authCode;

        public ConnectForm()
        {
            InitializeComponent();
        }

        private void GetStart_Load(object sender, EventArgs e)
        {
            Browser.Url = authUri;
        }

        private void Browser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            if (Browser.Document.Title.StartsWith("Success"))
            {
                authCode = Browser.Document.Title.Substring("Success code=".Length);
                this.Close();
                return;
            }
            return;
        }
    }
}
